home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgramD2.iso
/
Visual Database
/
Visual dBase v5.5
/
SAMPLES1.PAK
/
CAL.WFM
< prev
next >
Wrap
Text File
|
1995-07-18
|
31KB
|
1,088 lines
********************************************************************************
* PROGRAM: Cal.wfm
*
* WRITTEN BY: Borland Samples Group
*
* DATE: 5/93
*
* UPDATED: 6/95
*
* REVISION: $Revision: 2.86 $
*
* VERSION: Visual dBASE
*
* DESCRIPTION: This file contains a calculator form. This calculator
* contains pushbuttons for numeric input and operations. It also
* contains 2 entryfields -- the main display, showing the current
* calculation, and a memory display, showing current memory
* contents. Calculations can be performed in either decimal
* or hexadecimal systems.
*
* PARAMETERS: None
*
* CALLS: Buttons.cc
*
* USAGE: DO Cal.wfm
*
********************************************************************************
#define MAX_DEC_DIGITS 18
#define MAX_HEX_DIGITS 8
#define DISPLAY_LEN 18
#define HEX_OVERFLOW 2^32
#define DEC_OVERFLOW 10^18
create session && there are no tables in this program, but
&& this line ensures that the variable names used
&& here don't refer to any tables opened previously
set talk off
set ldCheck off
** END HEADER -- do not remove this line*
* Generated on 07/11/95
*
parameter bModal
local f
f = new CALFORM()
if (bModal)
f.mdi = .F. && ensure not MDI
f.ReadModal()
else
f.Open()
endif
CLASS CALFORM OF FORM
Set Procedure To &_dbwinhome.samples\BUTTONS.CC additive
this.OnOpen = CLASS::ONOPEN
this.OnGotFocus = CLASS::ONGOTFOCUS
this.Width = 34
this.OnClose = CLASS::ONCLOSE
this.Text = "Calculator"
this.Top = 0.7646
this.Maximize = .F.
this.Minimize = .F.
this.Left = 13.5
this.ColorNormal = "BTNTEXT/BTNFACE"
this.MousePointer = 1
this.Height = 11.2939
DEFINE RECTANGLE RECTANGLE2 OF THIS;
PROPERTY;
Width 33.0068,;
Text "",;
Top 8.3516,;
Left 0.6592,;
BorderStyle 1,;
Height 1.707
DEFINE RECTANGLE RECTANGLE1 OF THIS;
PROPERTY;
Width 33.0068,;
FontBold .F.,;
Text "",;
Top 2.1758,;
Left 0.6592,;
BorderStyle 1,;
Height 6.1768
DEFINE ENTRYFIELD DISPLAY OF THIS;
PROPERTY;
FontName "Arial",;
Width 33.0068,;
Function "J",;
Top 1.1172,;
Enabled .F.,;
Left 0.6592,;
ColorNormal "N/BG*",;
Value " 0",;
FontSize 12,;
Height 1.1768
DEFINE PUSHBUTTON B7 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0205,;
Group .T.,;
Text "7",;
Top 2.4688,;
Left 1.9795,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B8 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "8",;
Top 2.4688,;
Left 6.5,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B9 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "9",;
Top 2.4688,;
Left 11,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B4 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0205,;
Group .T.,;
Text "4",;
Top 3.9395,;
Left 1.9795,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B5 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "5",;
Top 3.9395,;
Left 6.5,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B6 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "6",;
Top 3.9395,;
Left 11,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B1 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0205,;
Group .T.,;
Text "1",;
Top 5.4102,;
Left 1.9795,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B2 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "2",;
Top 5.4102,;
Left 6.5,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON B3 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "3",;
Top 5.4102,;
Left 11,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON OPPLUSMINUS OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0205,;
Group .T.,;
Text "+/-",;
Top 6.8809,;
Left 1.9795,;
OnClick CLASS::PLUSMINUS_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON B0 OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "0",;
Top 6.8809,;
Left 6.5,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1777
DEFINE PUSHBUTTON PERIOD OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text " ",;
Top 6.8809,;
Left 11,;
OnClick CLASS::PERIOD_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON OPPOWER OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "^",;
Top 2.4688,;
Left 17,;
OnClick CLASS::OP_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON OPTIMES OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "*",;
Top 3.9395,;
Left 17,;
OnClick CLASS::OP_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON OPDIV OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "/",;
Top 5.4102,;
Left 17,;
OnClick CLASS::OP_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON OPMINUS OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "-",;
Top 6.8809,;
Left 17,;
OnClick CLASS::OP_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON CLEAR OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
FontBold .F.,;
Group .T.,;
Text "CE\C",;
Top 2.4688,;
Left 21.5,;
OnClick CLASS::CLEAR_CLICK,;
ColorNormal "W*/R",;
FontSize 7,;
Height 1.1777
DEFINE PUSHBUTTON OPEQUAL OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "=",;
Top 3.9395,;
Default .T.,;
Left 21.5,;
OnClick CLASS::OP_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON OPPLUS OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "+",;
Top 5.4102,;
Left 21.5,;
OnClick CLASS::OP_CLICK,;
FontSize 10,;
Height 1.1777
DEFINE PUSHBUTTON HEXDEC OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
FontBold .F.,;
Group .T.,;
Text "&Hex",;
Top 6.8809,;
Left 21.5,;
OnClick CLASS::CHANGEHEX,;
FontSize 7,;
Height 1.1777
DEFINE PUSHBUTTON MADD OF THIS;
PROPERTY;
FontName "Arial",;
Width 5.002,;
FontBold .F.,;
Group .T.,;
Text "&MAdd",;
Top 2.4688,;
Left 27.6641,;
OnClick CLASS::MEM_CLICK,;
ColorNormal "W+/B",;
FontSize 7,;
Height 1.1777
DEFINE PUSHBUTTON MSUB OF THIS;
PROPERTY;
FontName "Arial",;
Width 5.002,;
FontBold .F.,;
Group .T.,;
Text "M&Sub",;
Top 3.9395,;
Left 27.6641,;
OnClick CLASS::MEM_CLICK,;
ColorNormal "W+/B",;
FontSize 7,;
Height 1.1777
DEFINE PUSHBUTTON MRCL OF THIS;
PROPERTY;
FontName "Arial",;
Width 5.002,;
FontBold .F.,;
Group .T.,;
Text "M&Rcl",;
Top 5.4102,;
Left 27.6641,;
OnClick CLASS::MRCL_PROC,;
ColorNormal "W+/B",;
FontSize 7,;
Height 1.1777
DEFINE PUSHBUTTON MCLR OF THIS;
PROPERTY;
FontName "Arial",;
Width 5.002,;
FontBold .F.,;
Group .T.,;
Text "MClr",;
Top 6.8809,;
Left 27.6641,;
OnClick CLASS::MCLR_PROC,;
ColorNormal "W+/B",;
FontSize 7,;
Height 1.1777
DEFINE PUSHBUTTON B_A OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0205,;
Group .T.,;
Text "&A",;
Top 8.6465,;
Enabled .F.,;
Left 1.9795,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1768
DEFINE PUSHBUTTON B_B OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0352,;
Group .T.,;
Text "&B",;
Top 8.6465,;
Enabled .F.,;
Left 7.2979,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1768
DEFINE PUSHBUTTON B_C OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0684,;
Group .T.,;
Text "&C",;
Top 8.6465,;
Enabled .F.,;
Left 12.5977,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1768
DEFINE PUSHBUTTON B_D OF THIS;
PROPERTY;
FontName "Arial",;
Width 4,;
Group .T.,;
Text "&D",;
Top 8.6465,;
Enabled .F.,;
Left 18,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1768
DEFINE PUSHBUTTON B_E OF THIS;
PROPERTY;
FontName "Arial",;
Width 3.9688,;
Group .T.,;
Text "&E",;
Top 8.6465,;
Enabled .F.,;
Left 23.1973,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1768
DEFINE PUSHBUTTON B_F OF THIS;
PROPERTY;
FontName "Arial",;
Width 4.0684,;
Group .T.,;
Text "&F",;
Top 8.6465,;
Enabled .F.,;
Left 28.5977,;
OnClick CLASS::NUMERIC_CLICK,;
Height 1.1768
DEFINE ENTRYFIELD MEMORY OF THIS;
PROPERTY;
FontName "Arial",;
Width 33.0068,;
Function "J",;
Top 10,;
Enabled .F.,;
Left 0.6592,;
ColorNormal "BtnText/BtnFace",;
Value " ",;
FontSize 12,;
Height 1.1758
DEFINE SAMPLEINFOBUTTON CALINFOBUTTON OF THIS;
PROPERTY;
Width 3.5,;
Group .T.,;
Left 30,;
Height 1.1758
procedure OnOpen
****************************************************************************
set procedure to program(1) additive
this.periodChar = setto("point") && This is necessary for international
this.period.text = form.periodChar && applications
this.OpPlus.Doit = {|a,b|a+b}
this.OpPlus.precedence = 1
this.OpMinus.Doit = {|a,b|a-b}
this.OpMinus.precedence = 1
this.OpTimes.Doit = {|a,b|a*b}
this.OpTimes.precedence = 2
this.OpDiv.Doit = {|a,b|a/b}
this.OpDiv.precedence = 2
this.OpPower.Doit = {|a,b|a^b}
this.OpPower.precedence = 3
this.OpEqual.Doit = {|a,b|;}
this.OpEqual.precedence = 0
this.MAdd.Doit = {|a,b|a+b}
this.MAdd.precedence = 1
this.MSub.Doit = {|a,b|a-b}
this.MSub.precedence = 1
&& Stack for storing operation states
this.operationStack = new OperationStackClass()
this.hex = .F. && In hex or decimal mode
this.decPlaces = 1 && Start with minimum decimal places
&& Most decimal places in an operand
this.mostDecPlaces = 1
this.beforePeriod = .T. && Add numbers before or after decimal pt.
this.lastKeyOperator = .F.
this.DefineBackgroundTexts()
this.Clear.OnClick()
this.MClr.OnClick()
this.calInfoButton.sampleName = "Cal.wfm"
****************************************************************************
procedure OnClose
* Clean up
****************************************************************************
close procedure program(1)
****************************************************************************
procedure OnGotFocus
* Make sure decimal places is correct every time this form gets focus.
****************************************************************************
set decimals to form.decPlaces
****************************************************************************
procedure DefineBackgroundTexts
* Define texts behind non-alphabetic characters, so the picks for the text
* will execute the onclick for these buttons, and button text doesn't
* look cluttered and strange.
****************************************************************************
CLASS::DefineText(this.b1)
CLASS::DefineText(this.b2)
CLASS::DefineText(this.b3)
CLASS::DefineText(this.b4)
CLASS::DefineText(this.b5)
CLASS::DefineText(this.b6)
CLASS::DefineText(this.b7)
CLASS::DefineText(this.b8)
CLASS::DefineText(this.b9)
CLASS::DefineText(this.b0)
CLASS::DefineText(this.period)
CLASS::DefineText(this.opPower)
CLASS::DefineText(this.opTimes)
CLASS::DefineText(this.opDiv)
CLASS::DefineText(this.opMinus)
CLASS::DefineText(this.opPlus)
CLASS::DefineText(this.opEqual)
****************************************************************************
procedure DefineText(button)
* Define text to appear behind button. This text will be before the button
* in the tabbing order.
****************************************************************************
private textName
textName = button.name + "Text"
define text &textName of this;
property;
top button.top,;
left button.left,;
text "&" + button.text,;
width 3,;
before button
****************************************************************************
procedure ChangeHex
* Toggle from/to Hex display mode.
****************************************************************************
local value,memValue,dispFraction,memFraction
* Get values in display and memory before changing hex indicator
value = CLASS::NumVal(form.display.value)
memValue = CLASS::NumVal(form.memory.value)
form.beforePeriod = .T.
set decimals to form.decPlaces
dispFraction = val(substr(form.display.value,;
at(form.periodChar, form.display.value)))
memFraction = val(substr(form.memory.value,;
at(form.periodChar, form.memory.value)))
form.hex = .not. form.hex
this.text = iif(form.hex, "Dec", "&Hex")
* Enable/disable hex letter digits
store form.hex to ;
form.B_A.enabled, form.B_B.enabled, form.B_C.enabled,;
form.B_D.enabled, form.B_E.enabled, form.B_F.enabled
* Enable/disable keys not applicable to hex calculations
store .not. form.hex to form.opPlusMinus.enabled, form.period.enabled
if abs(value) >= HEX_OVERFLOW
*** Temporary
form.display.value = space(DISPLAY_LEN - MAX_HEX_DIGITS) +;
replicate("*", MAX_HEX_DIGITS)
else
form.display.value = CLASS::CharVal(value + dispFraction)
endif
if abs(memValue) >= HEX_OVERFLOW
form.memory.value = space(DISPLAY_LEN - MAX_HEX_DIGITS) +;
replicate("*", MAX_HEX_DIGITS)
else
form.memory.value = CLASS::CharVal(memValue + memFraction)
endif
****************************************************************************
procedure Numeric_Click
* Process a digit.
****************************************************************************
local num
if form.lastKeyOperator
form.LastKeyOperator = .F.
form.beforePeriod = .T.
form.display.value = space(MAX_DEC_DIGITS - 1) +;
CLASS::DisplayValue(this.text)
else
do case
case CLASS::DisplayFull()
??chr(7)
case form.beforePeriod
* Only want rightmost DISPLAY_LEN characters
form.display.value = right(;
CLASS::DisplayValue(form.display.value) +;
CLASS::DisplayValue(this.text), DISPLAY_LEN)
otherwise
form.display.value = CLASS::AddAfterPeriod(;
CLASS::DisplayValue(this.text))
endcase
endif
form.opEqual.SetFocus()
****************************************************************************
procedure Period_Click
* Process decimal point.
****************************************************************************
if form.beforePeriod .and. .not. form.hex
form.beforePeriod = .F.
form.decPlaces = 1
set decimals to 1
if form.lastKeyOperator
form.LastKeyOperator = .F.
form.display.value = space(MAX_DEC_DIGITS - 1) + form.periodChar
else
form.display.value = CLASS::AddAfterPeriod(form.periodChar)
endif
endif
****************************************************************************
procedure Op_Click
* Process operator.
****************************************************************************
private lastOperation, lastOp, lastValue, tempOpList, tempThis
if form.LastKeyOperator .or. form.operationStack.IsEmpty()
form.lastValue = CLASS::NumVal(form.display.value)
else
* Process all previous operations with >= precedence
do while form.operationStack.PrevPrecedenceGreaterOrEqual(this.precedence)
lastOperation = form.operationStack.Pop()
if lastOperation.GetPrecedence() > 0 && Don't process =
lastOp = lastOperation.GetOp()
lastValue = lastOperation.GetValue()
set decimals to form.mostDecPlaces
form.lastValue = lastOp(lastValue, CLASS::NumVal(form.display.value))
form.display.value = CLASS::CharVal(form.lastValue)
form.decPlaces = 1
set decimals to 1
endif
enddo
endif
form.beforePeriod = .T.
form.lastKeyOperator = .T.
tempThis = this
tempThis.value = CLASS::NumVal(form.display.value)
form.operationStack.Push(tempThis) && Problem with passing "this"
****************************************************************************
procedure Mem_Click
* Process a memory action button.
****************************************************************************
local result
result = this.Doit(CLASS::NumVal(form.memory.value),;
CLASS::NumVal(form.display.value))
form.memory.value = CLASS::CharVal(result)
****************************************************************************
procedure MClr_Proc
* Clear memory.
****************************************************************************
form.lastKeyOperator = .T.
form.memory.value = space(MAX_DEC_DIGITS - 1) + "0"
****************************************************************************
procedure MRcl_Proc
* Recall from memory.
****************************************************************************
if form.lastKeyOperator
form.LastKeyOperator = .F.
form.beforePeriod = .T.
form.lastValue = CLASS::NumVal(form.display.value)
form.display.value = form.memory.value
else
form.lastValue = CLASS::NumVal(form.display.value)
form.display.value = form.memory.value
endif
****************************************************************************
procedure Clear_Click
* Clear everything.
****************************************************************************
form.operationStack.Initialize() && Create empty operation stack
form.lastValue = 0 && Clear value
form.lastKeyOperator = .F. && Start with no operator keys pressed
form.decPlaces = 1 && Initial decimal places
set decimals to 1
form.mostDecPlaces = 1
form.display.value = space(MAX_DEC_DIGITS - 1) + "0"
form.beforePeriod = .T. && Start with whole number entry
****************************************************************************
procedure PlusMinus_Click
* Toggle sign of number in display.
****************************************************************************
local num
if .not. form.hex
num = CLASS::NumVal(form.display.value)
form.display.value = CLASS::CharVal(num * -1)
form.LastKeyOperator = .F.
endif
*******************************************************************************
function DisplayFull
* Check if display already has MAX_DEC_DIGITS digits in it
*******************************************************************************
private isFull, maxValueLen
maxValueLen = iif(form.hex, MAX_HEX_DIGITS, MAX_DEC_DIGITS)
* Check if leftmost digit in current display = " "
isFull = .not. empty(left(right(form.display.value, maxValueLen), 1))
return isFull
*******************************************************************************
function AddAfterPeriod(char)
* Add fractional digits after decimal point.
*******************************************************************************
form.decPlaces = form.decPlaces + 1
set decimals to form.decPlaces
form.mostDecPlaces = max(form.decPlaces, form.mostDecPlaces)
return CLASS::DisplayValue(form.display.value) + char
*******************************************************************************
function DisplayValue(value)
* Display value without the pick character.
*******************************************************************************
private num, pickLoc
num = value
pickLoc = at("&",num)
do case
case pickLoc <> 0
num = stuff(num,pickLoc,1,"")
case right(num,2) = " 0"
num = space(MAX_DEC_DIGITS)
case left(num,1) = " "
num = substr(num,2)
endcase
return num
*******************************************************************************
function CharVal(num)
* Make a string out of a numeric value in current hex/dec mode
*******************************************************************************
private string, fractionVal
if form.hex
if abs(num) >= HEX_OVERFLOW
string = replicate("*", MAX_HEX_DIGITS)
else
string = itoh(num)
string = space(MAX_DEC_DIGITS - len(string)) + string
endif
else
if abs(num) >= DEC_OVERFLOW
string = replicate("*", MAX_DEC_DIGITS)
else
string = str(num, MAX_DEC_DIGITS, form.decPlaces)
if val(right(string, form.decPlaces)) = 0 && If fraction = 0
string = str(num, MAX_DEC_DIGITS)
endif
endif
endif
return string
*******************************************************************************
function NumVal(string)
* Make a number out of a string, in current hex/dec mode.
*******************************************************************************
private h, num, periodLoc, s
s = string
if form.hex
h = htoi(string)
num = iif(h >= HEX_OVERFLOW/2, bitxor(h, HEX_OVERFLOW), h)
else
periodLoc = at(form.periodChar, s) && Use point setting for current
if periodLoc <> 0 && country
num = val(stuff(s, periodLoc, 1, "."))
else
num = val(s)
endif
endif
return num
ENDCLASS
*******************************************************************************
*******************************************************************************
CLASS OperationStackClass
* This class defines a stack object for storing mathematical operation states.
* This is necessary for using operators that have different precedence, like
* + and *. This is a stack of OperationStateClass objects.
*******************************************************************************
this.Initialize()
****************************************************************************
procedure Initialize
* Create empty stack
****************************************************************************
&& Bottom (and top, at first) of Stack
this.stackTop = new OperationStateClass()
****************************************************************************
function IsEmpty
* Check if stack is empty
****************************************************************************
return empty(this.stackTop.GetNext()) && Empty if no more operations
****************************************************************************
function Pop
* Retrieve last operation state
****************************************************************************
private operation
if empty(this.stackTop.GetNext())
operation = .F.
InformationMessage("ERROR: Trying to pop empty stack", "Info")
else
operation = this.stackTop
this.stackTop = this.stackTop.GetNext()
endif
return operation
****************************************************************************
procedure Push(operation)
* Save last operation state
****************************************************************************
private newStackTop
newStackTop = new operationStateClass() && Create new operationState
newStackTop.Assign(operation) && Assign to it properties of
&& operation
newStackTop.SetNext(this.stackTop) && Make current top be next
this.stackTop = newStackTop && Make new operation be top
****************************************************************************
function PrevPrecedenceGreaterOrEqual(curPrecedence)
* Retrieve last operation state
****************************************************************************
return (this.stackTop.GetPrecedence() >= curPrecedence)
ENDCLASS
*******************************************************************************
*******************************************************************************
CLASS OperationStateClass
* This class defines a single operation state, which is to be stored on the
* operationStack
*******************************************************************************
this.op = {|a,b|;} && Operation that accepts 2 operands, but does
this.precedence = -1 && nothing
this.value = 0
this.next = .F.
****************************************************************************
procedure GetOp
****************************************************************************
return this.op
****************************************************************************
procedure SetOp(newOp)
****************************************************************************
this.op = newOp
****************************************************************************
procedure GetPrecedence
****************************************************************************
return this.precedence
****************************************************************************
procedure SetPrecedence(newPrecedence)
****************************************************************************
this.precedence = newPrecedence
****************************************************************************
procedure GetValue
****************************************************************************
return this.value
****************************************************************************
procedure SetValue(newValue)
****************************************************************************
this.value = newValue
****************************************************************************
procedure GetNext
****************************************************************************
return this.next
****************************************************************************
procedure SetNext(newNext)
****************************************************************************
this.next = newNext
****************************************************************************
procedure Assign(newOperationState)
****************************************************************************
this.op = newOperationState.Doit
this.precedence = newOperationState.precedence
this.value = newOperationState.value
ENDCLASS